package org.aspire.core.game;

import org.aspire.core.Game;
import org.aspire.core.config.PCConfig;

/******************************************************************************
 * Aspire2D is specifically designed to support development portability across
 * multiple Java-supported gaming platforms. One major environment that support
 * Java is the Personal Computer or PC.
 * <p>
 * PCGame is a game that provides configuration settings for the PC platform.
 * These includes system-dependencies such as rendering utility, input devices,
 * etc.
 * <p>
 * Developers should extend this class if they are programming or porting their
 * game to the PC platform.
 * 
 * @author JPACarabuena
 *****************************************************************************/
public abstract class PCGame extends Game implements PCConfig {

	// ========================================================================
	// Constants
	// ========================================================================

	// ========================================================================
	// Static Methods
	// ========================================================================
	
	// ========================================================================
	// Fields
	// ========================================================================
	
	/**************************************************************************
	 * Whether or not the game is to be executed in full screen exclusive mode.
	 * The default display view is windowed-decorated mode.  
	 * 
	 * Default: false
	 *************************************************************************/
	private boolean fullscreen;
	
	/**************************************************************************
	 * Whether or not the game, if using hardware-accelerated graphics, will
	 * use buffer strategy in creating graphics context or back buffer. By
	 * disabling this, the game will instead use a volatile image as an off
	 * screen for generating graphics context or back buffer.
	 * 
	 * Default: true
	 *************************************************************************/
	private boolean bufferStrategy;
	
	/**************************************************************************
	 * Whether or not the game is to be rendered to the screen using OpenGL.
	 * The default rendering utility is hardware-accelerated graphics.
	 * 
	 * Default: false
	 *************************************************************************/
	private boolean openGL;
	
	/**************************************************************************
	 * Whether or not the game, if using OpenGL rendering utility, will use
	 * VSync option. By disabling this,
	 * 
	 * Default: true
	 *************************************************************************/
	private boolean vSync;
	
	/**************************************************************************
	 * Whether or not the game will use the mouse as an input device. By
	 * disabling this, user input through the mouse will be ignored.
	 * 
	 * Default: true
	 *************************************************************************/
	private boolean mouse;
	
	/**************************************************************************
	 * Whether or not the game will use the keyboard as an input device. By
	 * disabling this, user input through the keyboard will be ignored.
	 * 
	 * Default: true
	 *************************************************************************/
	private boolean keyboard;
	
	/**************************************************************************
	 * Whether or not the game will use a joystick as an input device. By
	 * enabling this, user input through the joystick will be processed.
	 * 
	 * Default: false
	 *************************************************************************/
	private boolean joystick;
	
	/**************************************************************************
	 * Whether or not the game will use a precise loop controller instead of
	 * the standard loop controller provided by the Java Standard Library. This
	 * is achieve through LWJGL Sys.getTime() method.
	 * 
	 * Default: false
	 *************************************************************************/
	private boolean precise;
	
	/**************************************************************************
	 * The base class loader for the game.
	 * 
	 * Default: PCGame
	 *************************************************************************/
	private Class<?> base = PCGame.class;
	
	// ========================================================================
	// Constructors
	// ========================================================================
	
	// ========================================================================
	// Getters & Setters
	// ========================================================================
	
	// ========================================================================
	// Override Methods
	// ========================================================================

	@Override
	public boolean isFullScreenExclusiveModeEnabled() {
		return this.fullscreen;
	}
	
	@Override
	public boolean isBufferStrategyEnabled() {
		return this.bufferStrategy;
	}
	
	@Override
	public boolean isOpenGLEnabled() {
		return this.openGL;
	}
	
	@Override
	public boolean isVSyncEnabled() {
		return this.vSync;
	}
	
	@Override
	public boolean isMouseEnabled() {
		return this.mouse;
	}
	
	@Override
	public boolean isKeyboardEnabled() {
		return this.keyboard;
	}
	
	@Override
	public boolean isJoystickEnabled() {
		return this.joystick;
	}
	
	@Override
	public boolean isPreciseLoopControllerEnabled() {
		return this.precise;
	}
	
	@Override
	public Class<?> getBaseClass() {
		return this.base;
	}
	
	@Override
	public void enableFullScreenExclusiveMode(boolean fullscreen) {
		this.fullscreen = fullscreen;
	}
	
	@Override
	public void enableBufferStrategy(boolean bufferStrategy) {
		this.bufferStrategy = bufferStrategy;
	}
	
	@Override
	public void enableOpenGL(boolean openGL) {
		this.openGL = openGL;
	}
	
	@Override
	public void enableVSync(boolean vSync) {
		this.vSync = vSync;
	}
	
	@Override
	public void enableMouse(boolean mouse) {
		this.mouse = mouse;
	}
	
	@Override
	public void enableKeyboard(boolean keyboard) {
		this.keyboard = keyboard;
	}
	
	@Override
	public void enableJoystick(boolean joystick) {
		this.joystick = joystick;
	}
	
	@Override
	public void enablePreciseLoopController(boolean precise) {
		this.precise = precise;
	}
	
	@Override
	public void setBaseClass(Class<?> base) {
		this.base = base;
	}
	
	// ========================================================================
	// Methods
	// ========================================================================
	
	// ========================================================================
	// Inner & Anonymous Classes
	// ========================================================================
}